const Mock = require('mockjs');
const result = Mock.mock({
    "data|16": [{
        "id|+1": 1,
        name: function () {
            return `书籍第 ${this.id} 本`;
        },
        author: "@cname",
        createAt: "@date"
    }]
})
const Book = require('./models/Book');
// 执行批量插入操作并处理 Promise
Book.bulkCreate(result.data)
    .then(() => {
        console.log('数据插入成功');
    })
    .catch((error) => {
        console.error('数据插入失败:', error);
    });
